package a4_p04_ak_fh_test;

import static org.junit.Assert.assertEquals;

import java.util.HashSet;
import java.util.Set;

import org.jgrapht.WeightedGraph;
import org.jgrapht.graph.DefaultWeightedEdge;
import org.junit.Test;

import a2_p04_ak_fh.AttVertex;
import a2_p04_ak_fh.IOHelper;
import a4_p04_ak_fh.Fleury;
import a4_p04_ak_fh.RandomEulerGraph;

public class FlueuryTest {


	@Test
	public void testGraph4T1() {

		System.out.println("Test T1");
		
		IOHelper IOHelper = new IOHelper();
		
		WeightedGraph<AttVertex, DefaultWeightedEdge> graph2 = IOHelper.readGraphFile("t1.gka");
		Fleury graphlist2 = Fleury.Calc(graph2);
		
		assertEquals(true,graphlist2.getEulerWay().containsAll(graph2.vertexSet()));
		
		System.out.println("Zeit: " + graphlist2.getTimeInMillis() + "ms");
	}
	
	
	@Test
	public void testRandomFromFile() {

		System.out.println("Test RandomFromFile");
		
		IOHelper IOHelper = new IOHelper();
		
		WeightedGraph<AttVertex, DefaultWeightedEdge> graph = IOHelper.readGraphFile("RandomEulerBIG.gka");

		Fleury graphlist = Fleury.Calc(graph);
		
		assertEquals(true,graphlist.getEulerWay().containsAll(graph.vertexSet()));
		System.out.println("Zeit: " + graphlist.getTimeInMillis() + "ms");
	}
	/*
	@Test
	public void testGraphRandom() {

		System.out.println("Test Random");

		WeightedGraph<AttVertex, DefaultWeightedEdge> graph = RandomEulerGraph.getEulerGraph(200, 10000);

		Fleury graphlist = Fleury.Calc(graph);
		
		assertEquals(true,graphlist.getEulerWay().containsAll(graph.vertexSet()));
		System.out.println("Zeit: " + graphlist.getTimeInMillis() + "ms");
	}
	
	*/
}
